<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta http-equiv="Content-Type" content="multipart/form-data; charset=utf-8" />

<link rel="stylesheet" href="../../css/iconfont/iconfont.css">
<link rel="stylesheet" href="../../css/easyui/easyui.css">
<link rel="stylesheet" href="../../css/easyui/icon.css">
<link rel="stylesheet" href="../../css/css.css">
<link rel="stylesheet" href="../../css/site.css">
<link rel="stylesheet" href="../../css/view/equBasic/EquBasic.css">

<script src="../../js/common/jQuery.js"></script>
<script src="../../js/common/jquery.easyui.min.js"></script>
<script src="../../js/common/app.js"></script>
<script src="../../js/common/common.js"></script>
<script src="../../js/common/slidebar.js"></script>
<script src="../../js/common/ajaxfileupload.js"></script>
<script src="../../js/common/easyui-lang-zh_CN.js"></script>
<script src="../../js/common/pinying.js"></script>
<script src="../../js/common/date_format.js"></script>
<!--初始化-->
<script>
    $(function() {
		data_json = null;
		initGrid(data_json);

	})

	function initGrid(data_json) {
		var parentstore = parent.$("#store").val();
		if(parentstore!="数信网办公室"&&parentstore!="集团办公室"){
			var isornot = document.getElementById("IsOrNotShow");
            isornot.style.display='none';
		}
		if(data_json==null){
			data_json = {
				"parentstore":parentstore
			}
		}else{
		    data_json.parentstore = parentstore;
		}
		$.ajax({
			url: "../../goLogis/initPage", //请求的url地址
			xhrFields: {
				withCredentials: true
			},
			dataType: "json", //返回格式为json
			type: "GET", //请求方式
			processData: false, //对表单data数据是否进行序列化
			contentType: false, //dataType设置你收到服务器数据的格式
			headers: {
				'Content-Type': 'application/json'
			},
			beforeSend: function() {
				//请求前的处理
			},
			success: function(data) {
				if(data.status == "-1") {
					top.location.href = "../../login.html";
				}else{
				    var storejson = data.data;
                    var temdata = JSON.parse(storejson);
                    var resdata = temdata.arrdata;

                    var data = [];
                    $.each(resdata, function(i,val){
                        //这里的"text","id"和html中对应
                        data.push({ "text": val.ming, "id": val.ming,"selected":val.selected });
                    })
                    $("#store").combobox("loadData", data);
                    //设置类别下拉框
                    var typedata = [];
                    var equtypedata = temdata.equtypedata;
                    $.each(equtypedata, function(i,val){
                        //这里的"text","id"和html中对应
                        typedata.push({ "text": val.SetValue, "id": val.SetValue,"selected":val.selected });
                    })
                    $("#ADEquType").combobox("loadData", typedata);
                    typedata.push({ "text": "全部", "id": "全部","selected":"selected" })
                    $("#QEquType").combobox("loadData", typedata);
                }

			},
			complete: function() {
				//请求完成的处理
			},
			error: function() {}
		});
		$("#dg").datagrid({
			onDblClickRow: function(rowIndex, rowData) {
				var row = $('#dg').datagrid('getSelected');
				$("#DEquName").attr("value", row.EquName);
				$("#DLifeTime").attr("value", row.LifeTime);
				$("#DStartTime").attr("value", row.StartTime);
				$("#DEndTime").attr("value", row.EndTime);
				$("#DBuyInMoney").attr("value", row.BuyInMoney);
				$("#DLastConseTime").attr("value", row.LastConseTime);
				$("#DNextConseTime").attr("value", row.NextConseTime);
				$("#DEquType").attr("value", row.EquType);
				$("#DPurchaseType").attr("value", row.PurchaseType);
				$("#DStore").attr("value", row.Store);
				$("#DEquStatus").attr("value", row.EquStatus);
				$("#DEquNo").attr("value", row.EquNo);
				$("#DConsePeriod").attr("value", row.ConsePeriod);
				$("#DSpecification").attr("value", row.Specification);
				$("#DPlace").attr("value", row.Place);
				$("#DServCondition").attr("value", row.ServCondition);
				$("#DBuyInTime").attr("value", row.BuyInTime);
				$("#DEquId").attr("value", row.ID);
				var id = row.ID;
				var EquNo = row.EquNo;
				var imageData = {"EquNo":EquNo};
				dataImg = JSON.stringify(imageData);
				$.ajax({
					url: "../../goLogis/queryImageUrlByEquNo", //请求的url地址
					dataType: "json", //返回格式为json
					data: dataImg, //参数值
					type: "POST", //请求方式
					processData: false, //对表单data数据是否进行序列化
					contentType: false, //dataType设置你收到服务器数据的格式
					headers: {
						'Content-Type': 'application/json'
					},
					beforeSend: function() {
						//请求前的处理
					},
					success: function(data) {
						$("#BasicImg1").attr("src", data.ImageUrl1);
						$("#BasicImg2").attr("src", data.ImageUrl2);
						$("#BasicImg3").attr("src", data.ImageUrl3);
					},
					complete: function() {
						//请求完成的处理
					},
					error: function() {
//						$.messager.alert('保存资产信息', data.status);
					}
				});
				$("#ConserveCourseDialogDg").datagrid({
					url: "../../goLogis/queryBasicEquCourseById?id=" + id,
					title: "维护信息",
					method: "GET",
					singleSelect: false, //如果为true，则只允许选择一行。
					ctrlSelect: true, //在启用多行选择的时候允许使用Ctrl键+鼠标点击的方式进行多选操作。
					fitColumns: true, //真正的自动展开/收缩列的大小，以适应网格的宽度，防止水平滚动。
					striped: true, //是否显示斑马线效果
					/* loadMsg:"Processing, please wait …", */ //在从远程站点加载数据的时候显示提示消息。
					rownumbers: true, //如果设置为true则会添加一列来显示行号。
					pageSize: 15, //在设置分页属性的时候初始化页面数据条数。
					pageList: [15], //在设置分页属性的时候 初始化页面数据显示条数选择列表
					toolbar: [],
					columns: [
						[
							//这里的field对应的是后台的字段属性
							{
								field: "DocNo",
								title: "单据编号",
								width: 50
							},
                            {
                                field: "ConseType",
                                title: "维护类型",
                                width: 100
                            },
							{
								field: "ConseTime",
								title: "完成时间",
								width: 50
							},
							{
								field: "Cost",
								title: "费用",
								width: 50
							},
							{
								field: "ConseReason",
								title: "维护原因",
								width: 100
							},
							{
								field: "ConseResult",
								title: "维护结果",
								width: 100
							},
						]
					]
				});
				$('#basicInfoDialog').dialog('open');
			},
            rowStyler:function(index,row){
                var s1  =  row.BuyInTime;
                var s2 = new Date();
                var sc = s2.Format("yyyy-MM-dd");
                var s3 = row.LastConseTime;
                if(!(typeof(s3)=="undefined")){
                    if((row.ConsePeriod-DateDiff(s3,sc))<=20){
                        return 'background-color:yellow;';
                    }
                }
                if((row.LifeTime*365-DateDiff(s1,sc))<=0){
                    return 'background-color:red;';
                }
                //创建时间如果超过一天，不显示修改功能

            },
			url: "../../goLogis/queryAllBasicEqu",
			method: "POST",
            queryParams:data_json,
			singleSelect: false, //如果为true，则只允许选择一行。
			ctrlSelect: true, //在启用多行选择的时候允许使用Ctrl键+鼠标点击的方式进行多选操作。
			// fitColumns: true, //真正的自动展开/收缩列的大小，以适应网格的宽度，防止水平滚动。
			striped: true, //是否显示斑马线效果
			/* loadMsg:"Processing, please wait …", */ //在从远程站点加载数据的时候显示提示消息。
			rownumbers: true, //如果设置为true则会添加一列来显示行号。
			pagination: true, //如果为true，则在DataGrid控件底部显示分页工具栏。
			pageSize: 15, //在设置分页属性的时候初始化页面数据条数。
			pageList: [15], //在设置分页属性的时候 初始化页面数据显示条数选择列表
			toolbar: '#tb',
            showFooter:true,
            columns: [
				[
					//这里的field对应的是后台的字段属性
					{
						field: "ID",
						title: "ckID",
						width: 50,
						checkbox: true
					},
                    {
                        field: "EquNo",
                        title: "设备编号",
                        width: 100
                    },
					{
						field: "Store",
						title: "中心店面",
						width: 100
					},
					{
						field: "EquName",
						title: "资产名称",
						width: 100
					},
                    {
                        field: "Specification",
                        title: "型号-规格",
                        width: 80
                    },
                    {
                        field: "EquType",
                        title: "类别",
                        width: 50
                    },
                    {
                        field: "ServCondition",
                        title: "使用状况",
                        width: 80
                    },
					{
						field: "LifeTime",
						title: "寿命（年）",
						width: 50
					},
                    {
                        field: "BuyInTime",
                        title: "购入日期",
                        width: 100
                    },
					{
						field: "StartTime",
						title: "开始使用时间",
						width: 100
					},
					{
						field: "EndTime",
						title: "使用截止日期",
						width: 100
					},
					{
						field: "BuyInMoney",
						title: "购买费用（元）",
						width: 100
					},

					
					/*{field:'deleteBasic',title:'操作',width:80,
			            formatter:function(value,rec){  
			                var btn = '<a class="editcls" onclick="deleteOneRow(\''+rec.ID+'\',\''+rec.EquNo+'\')" href="javascript:void(0)">删除</a>';  
                			return btn;  
			            }  
			        },*/
			        {field:'editBasic',title:'操作',width:80,  
			            formatter:function(value,rec){
                            var s2 = new Date();
                            var sc = s2.Format("yyyy-MM-dd");
                            var zc = rec.NextConseTime;
                            var btn;
                            if(zc==null){
                                btn = '<a class="editcls" style="display: none" onclick="editOneRow(\''+rec.EquName+'\',\''+rec.ID+'\',\''+rec.Place+'\',\''+rec.ConsePeriod+'\',\''+rec.EquStatus+'\',\''+rec.PurchaseType+'\',\''+rec.EquType+'\',\''+rec.Store+'\',\''+rec.EquNo+'\',\''+rec.LifeTime+'\',\''+rec.StartTime+'\',\''+rec.EndTime+'\',\''+rec.BuyInTime+'\',\''+rec.BuyInMoney+'\',\''+rec.ServCondition+'\')" href="javascript:void(0)">修改</a>';
                            }else if(DateDiff(zc,sc)>1){
                                btn = '<a class="editcls" style="display: none" onclick="editOneRow(\''+rec.EquName+'\',\''+rec.ID+'\',\''+rec.Place+'\',\''+rec.ConsePeriod+'\',\''+rec.EquStatus+'\',\''+rec.PurchaseType+'\',\''+rec.EquType+'\',\''+rec.Store+'\',\''+rec.EquNo+'\',\''+rec.LifeTime+'\',\''+rec.StartTime+'\',\''+rec.EndTime+'\',\''+rec.BuyInTime+'\',\''+rec.BuyInMoney+'\',\''+rec.ServCondition+'\')" href="javascript:void(0)">修改</a>';
                            }else{
                                btn = '<a class="editcls" onclick="editOneRow(\''+rec.EquName+'\',\''+rec.ID+'\',\''+rec.Place+'\',\''+rec.ConsePeriod+'\',\''+rec.EquStatus+'\',\''+rec.PurchaseType+'\',\''+rec.EquType+'\',\''+rec.Store+'\',\''+rec.EquNo+'\',\''+rec.LifeTime+'\',\''+rec.StartTime+'\',\''+rec.EndTime+'\',\''+rec.BuyInTime+'\',\''+rec.BuyInMoney+'\',\''+rec.ServCondition+'\')" href="javascript:void(0)">修改</a>';
							}
                			return btn;
			            }  
			        },
                    {field:'uploadEditImage',title:'操作',width:80,
                        formatter:function(value,rec){
                            var btn = '<a class="editcls" onclick="uploadEditImage(\''+rec.EquNo+'\')" href="javascript:void(0)">上传图片</a>';
                            return btn;
                        }
                    },
                ]
			]
		});
		var pager = $('#dg').datagrid('getPager');
		$(pager).pagination({
			pageSize: 15,
			pageList: [15],
			onSelectPage: function(pageNumber, pageSize) {
				var rows = pageSize;
				var page = pageNumber;
				$.ajax({
					type: "post",
					data: data_json,
					async: false,
					url: "../../goLogis/queryAllBasicEqu?rows=" + rows + "&page=" + page,
					dataType: "json",
					// jsonp: "callback",
					// jsonpCallback: "callback",
					success: function(data) {
						$('#dg').datagrid('loadData', data);
					},
					error: function(xhr) {
					}
				});
			},
			beforePageText: '第', //页数文本框前显示的汉字 
			afterPageText: '页    共 {pages} 页',
			displayMsg: '当前显示 {from} - {to} 条记录   共 {total} 条记录',
		});
	}
	
	/*删除其中一行*/
	function deleteOneRow(id,EquNo){
		var jsondata = {
			"ID":id,
			"EquNo":EquNo
		}
		var data_json = JSON.stringify(jsondata);
				$.ajax({
					url: "../../goLogis/delBasicEquById", //请求的url地址
					dataType: "json", //返回格式为json
					data: data_json, //参数值
					type: "POST", //请求方式
					processData: false, //对表单data数据是否进行序列化
					contentType: false, //dataType设置你收到服务器数据的格式
					headers: {
						'Content-Type': 'application/json'
					},
					beforeSend: function() {
					},
					success: function(data) {
						if(data.Status==1){
							$.messager.alert('提示', '删除成功');
							$("#dg").datagrid('reload'); 
						}else if(data.Status==-2){
                            $.messager.alert('提示', '当前为合计行，不可删除');
                            return false;
						}else {
							$.messager.alert('提示', '该资产不存在图片，已删除');
                            $("#dg").datagrid('reload');
                        }
					},
					complete: function() {
					},
					error: function() {
					}
				});	
	}
	/*字符串转控件字符串*/
	function strToDateBoxStr(str){
		var arr = str.split(" "); 
		var sdate = arr[0].split('-'); 
		var datestr =sdate[1]+"/"+sdate[2]+"/"+sdate[0]; 
		return datestr;
	}
	/*编辑其中一行（弹出编辑dialog）*/
	function editOneRow(EquName,ID,Place,ConsePeriod,EquStatus,PurchaseType,EquType,Store,EquNo,LifeTime,StartTime,EndTime,BuyInTime,BuyInMoney,ServCondition){
		if(EquNo=="undefined"){
		    $.messager.alert("提示","当前为合计行，不可修改");
            return false;
		}

        $("#EADEquName").attr("value",EquName);
        $("#EADLifeTime").attr("value",LifeTime);
        $("#EADServCondition").attr("value",ServCondition);
        $("#EADBuyInMoney").attr("value",BuyInMoney);
        $("#EADEquType").attr("value",EquType);
        $("#EADBuyInTime").datebox("setValue",BuyInTime);
        $("#EADStartTime").datebox("setValue",StartTime);
//		$("#EADEndTime").attr("value",EndTime);
        $("#EADEndTime").datebox("setValue",EndTime);

        $("#EADPurchaseType").attr("value",PurchaseType);
        $("#EADStore").attr("value",Store);
        $("#EADEquStatus").attr("value",EquStatus);
        $("#EADEquNo").attr("value",EquNo);
        $("#EADConsePeriod").attr("value",ConsePeriod);
        $("#EADSpecification").attr("value",ServCondition);
        $("#EADPlace").attr("value",Place);
        $("#EADConsePeriod").attr("value",ConsePeriod);

        $.ajax({
            url: "../../goLogis/initPage", //请求的url地址
            xhrFields: {
                withCredentials: true
            },
            dataType: "json", //返回格式为json
            type: "GET", //请求方式
            processData: false, //对表单data数据是否进行序列化
            contentType: false, //dataType设置你收到服务器数据的格式
            headers: {
                'Content-Type': 'application/json'
            },
            beforeSend: function() {
                //请求前的处理
            },
            success: function(data) {
                if(data.status == "-1") {
                    top.location.href = "../../login.html";
                }else{
                    var storejson = data.data;
                    var temdata = JSON.parse(storejson);
                    //设置类别下拉框
                    var typedata = [];
                    var typedata = temdata.equtypedata;
                    var equtypedata = [];
                    for(var i=0;i<typedata.length;i++){
                        var tempEquData = typedata[i];
                        var tempEqu = tempEquData.SetValue;
                        if(EquType==tempEqu){
                            equtypedata.push({ "text": typedata[i].SetValue, "id": typedata[i].SetValue,"selected":"selected" });
                        }else{
                            equtypedata.push({ "text": typedata[i].SetValue, "id": typedata[i].SetValue});
                        }
					}
                    $("#EADEquType").combobox("loadData", equtypedata);
                    $("#editBasicInfoDialog").dialog("open");
                }

            },
            complete: function() {
                //请求完成的处理
            },
            error: function() {}
        });

	}

	/*上传修改图片*/
	function uploadEditImage(EquNo){
	    $("#EIEquNo").attr("value",EquNo);
        $('#uploadEditImage').dialog('open');
	}

</script>

<!--datagrid-->
<div>
	<table id="dg" style="width: 1200px;"></table>
</div>

<!--操作按钮-->
<div id="tb" style="padding:2px 5px;">
	<div style="margin-left: 20px;float:left" id="IsOrNotShow">
		中心店面
		<select id="store" class="easyui-combobox"  style="width:100px" panelHeight="auto" data-options="valueField:'id', textField:'text'" editable="false">
		</select>
	</div>
	<div style="margin-left: 20px;float:left">
		类别
		<select id="QEquType" class="easyui-combobox"  style="width:100px" panelHeight="auto" data-options="valueField:'id', textField:'text'" editable="false">
		</select>
	</div>
	<div style="margin-left: 20px;float:left">
		使用状况
		<select  id="ServCondition" class="easyui-combobox" panelHeight="auto" style="width:100px"  editable="false">
			<option value="" selected="selected" >全部</option>
			<option value="良好">良好</option>
			<option value="故障">故障</option>
			<option value="已停用">已停用</option>
		</select>
	</div>
	<div style="margin-left: 20px;float:left">
		剩余使用寿命<input type="text" id="RestYear" class="easyui-textbox" style="width:80px">年内
	</div>
	<div style="margin-left: 20px;float:left">
		购入日期:<input type="text" id="BuyInStartDate" name="BuyInStartDate" class="easyui-datebox" editable="false" >
	</div>
	<div style="margin-left: 20px;float:left">
		到 &nbsp&nbsp&nbsp <input type="text" id="BuyInEndDate" name="BuyInEndDate" class="easyui-datebox" editable="false">
	</div>




	<a href="#" class="easyui-linkbutton" iconCls="icon-search" plain="true" onclick="queryBasicListByCondition()">查询</a>
	<script type="">function queryBasicListByCondition() {
	var store = $('#store').combobox('getText');
	var EquType = $('#QEquType').combobox('getText');
	if(EquType=="全部"){
	    EquType = null;
    }
	var ServCondition = $("#ServCondition").val();
	var BuyInStartDate = $("#BuyInStartDate").val();
	var BuyInEndDate = $("#BuyInEndDate").val();
	var parentstore = parent.$("store").val();
	var RestYear = $("#RestYear").val();
	var r = /^\+?[1-9][0-9]*$/;　　
	var flag=r.test(RestYear);
	if(RestYear==''){
	}else{
        if(!flag){
            $.messager.alert("提示","剩余使用寿命请输入正整数");
            return false;
        }
    }
	var jsondata = {
	    "EquType":EquType,
	    "RestYear":RestYear,
		"parentstore":parentstore,
		"store": store,
		"ServCondition":ServCondition,
		"BuyInStartDate": BuyInStartDate,
		"BuyInEndDate": BuyInEndDate
	}
	initGrid(jsondata); 
	}
	</script>
	<a href="#" class="easyui-linkbutton" iconCls="icon-undo" plain="true" onclick="reset()">重置</a>
	<script>
		function reset() {
            var BuyInStartDate = $("#BuyInStartDate");
            BuyInStartDate.datebox("setValue","");
            var BuyInEndDate = $("#BuyInEndDate");
            BuyInEndDate.datebox("setValue","");
			jsondata = null;
			initGrid(jsondata);
		}
	</script>
	<a href="#" class="easyui-linkbutton" iconCls="icon-search" plain="true" onclick="addEquBasicInfos()">新增</a>
	<script>
		function addEquBasicInfos() {
            var timestamp = Date.parse(new Date());
			var u = parent.$("#username").val();
			var parentstore = parent.$("#store").val();
            var arrRslt = makePy(parentstore);
            var DocNoStr = arrRslt+timestamp;
            $("#ADEquNo").attr("value",DocNoStr);
			$("#EnterMan").attr("value",u);
            $("#ADStore").attr("value",parentstore);
			$('#addBasicInfoDialog').dialog('open');
		}
	</script>
	<a href="#" class="easyui-linkbutton" iconCls="icon-search" plain="true" onclick="inportexcel()">导出</a>
<script>
	function inportexcel(){
        var store = $('#store').combobox('getText');
        if(store=='全部'){
            store = null;
		}
        var EquType = $('#QEquType').combobox('getText');
        if(EquType=="全部"){
            EquType = null;
        }
        var ServCondition = $("#ServCondition").val();
        var BuyInStartDate = $("#BuyInStartDate").val();
        var BuyInEndDate = $("#BuyInEndDate").val();
        var parentstore = parent.$("store").val();
        var RestYear = $("#RestYear").val();
        var r = /^\+?[1-9][0-9]*$/;
        var flag=r.test(RestYear);
        if(RestYear==''){
        }else{
            if(!flag){
                $.messager.alert("提示","剩余使用寿命请输入正整数");
                return false;
            }
        }
        var jsondata = {
            "EquType":EquType,
            "RestYear":RestYear,
            "parentstore":parentstore,
            "store": store,
            "ServCondition":ServCondition,
            "BuyInStartDate": BuyInStartDate,
            "BuyInEndDate": BuyInEndDate
        }
        var data_json = JSON.stringify(jsondata);
        window.location.href="../../goLogis/CreateBasicExcel?EquType="+EquType+"&RestYear="+RestYear+"&parentstore="+parentstore+"&store="+store+"&ServCondition="+ServCondition+"&BuyInStartDate="+BuyInStartDate+"&BuyInEndDate="+BuyInEndDate;
	}

</script>
</div>

<!--dialog-->
<!--资产详细信息dialog-->
<div id="basicInfoDialog" class="easyui-dialog" title="资产详细资料" style="width: 1030px; height: 600px;text-align:center;top:50px;display: none;overflow: hidden;" data-options="iconCls:'icon-save',resizable:true,modal:true,closed:true,closable:true ">
	<div style="width:70%;text-align: left;">
		<a href="#" class="easyui-linkbutton" iconCls="icon-remove" data-options="iconCls:'icon-cancel'" plain="true" onclick="closeDiv1()">关闭</a>
		<script>
			function closeDiv1() {
				$('#basicInfoDialog').dialog('close');
			}
		</script>
	</div>
	<!--资产基本信息-->
	<div>
		<div class="panel-header" style="width:918px;text-align: left;">
			<div class="panel-title">资产基本信息</div>
			<div class="panel-tool"></div>
		</div>
		<table width="900" height="149" class="BuyBack">
			<tr>
				<td width="87" class="odd"><span>设备编号</span></td>
				<td width="127" class="even"><span><input type="text" style="width: 120px;height: 23px" readonly="readonly"
														  id="DEquNo"/></span></td>
				<td width="109" height="36" class="odd"><span>资产名称</span></td>
				<td width="127" class="even"><span><input type="text" style="width: 120px;height: 23px" readonly="readonly"
	                                                      id="DEquName" /></span></td>
				<td width="87" class="odd"><span>开始使用时间</span></td>
				<td width="127" class="even"><span><input type="text" style="width: 120px;height: 23px" readonly="readonly"
	                                                      id="DStartTime"/></span></td>
				<td width="87" class="odd"><span>截止使用时间</span></td>
				<td width="127" class="even"><span><input type="text" style="width: 120px;height: 23px" readonly="readonly"
	                                                     id="DEndTime"/></span></td>
			</tr>
			<tr>
				<td width="109" height="36" class="odd"><span>购入价格</span></td>
				<td width="127" class="even"><span><input type="text" style="width: 120px;height: 23px" readonly="readonly"
	                                                      id="DBuyInMoney" /></span></td>
				<td width="109" height="36" class="odd"><span>购入时间</span></td>
				<td width="127" class="even"><span><input type="text" style="width: 120px;height: 23px" readonly="readonly"
														  id="DBuyInTime" /></span></td>
				<td width="87" class="odd"><span>使用状况</span></td>
				<td width="127" class="even"><span><input type="text" style="width: 120px;height: 23px" readonly="readonly"
														  id="DServCondition"/></span></td>
				<td width="87" class="odd"><span>类别</span></td>
				<td width="127" class="even"><span><input type="text" style="width: 120px;height: 23px" readonly="readonly"
	                                                     id="DEquType"/></span></td>
			</tr>
			<tr>
				<td width="109" height="36" class="odd"><span>购置方式</span></td>
				<td width="127" class="even"><span><input type="text" style="width: 120px;height: 23px" readonly="readonly"
	                                                      id="DPurchaseType" /></span></td>
				<td width="84" class="odd"><span>中心店面</span></td>
				<td width="127" class="even"><span><input type="text" style="width: 120px;height: 23px" readonly="readonly"
	                                                      id="DStore"/></span></td>
				<td width="87" class="odd"><span>所处状态</span></td>
				<td width="127" class="even"><span><input type="text" style="width: 120px;height: 23px" readonly="readonly"
	                                                      id="DEquStatus"/></span></td>
				<td width="84" class="odd"><span>寿命</span></td>
				<td width="127" class="even"><span><input type="text" style="width: 120px;height: 23px" readonly="readonly"
														  id="DLifeTime"/></span></td>
			</tr>
			<tr>
				<td width="84" class="odd"><span>型号-规格</span></td>
                <td width="127" class="even"><span><input type="text" style="width: 120px;height: 23px" readonly="readonly"
                id="DSpecification"/></span></td>
                <td width="87" class="odd"><span>存放地点</span></td>
                <td width="127" class="even"><span><input type="text" style="width: 120px;height: 23px" readonly="readonly"
                id="DPlace"/></span></td>
                <td width="109" height="36" class="odd"><span>维护周期(天)</span></td>
                <td width="127" class="even"><span><input type="text" style="width: 120px;height: 23px;" readonly="readonly"
                                                          id="DConsePeriod" /></span></td>
                <td width="127" class="even" style="display: none"><span><input type="text" style="width: 120px;height: 23px;display: none" readonly="readonly"
																				id="DEquId" /></span></td>
			</tr>
		</table>
	</div>
	<!--维护历程信息-->
	<div>
		<table id="ConserveCourseDialogDg" style="width: 930px;height: 200px;"></table>
	</div>
	<!--资产附件展示-->
	<div>
		<div class="panel-header" style="width:918px;text-align: left;">
			<div class="panel-title">资产附件展示</div>
			<div class="panel-tool"></div>
		</div>

		<div class="left-sprite">
		</div>
		<div class="right-sprite">
		</div>
		<div class="imgs">
			<div class="rongqi">
				<ul>
					<li style="float: left;">
						<p class="img-item"><img id="BasicImg1" style="width: 100px;height: 100px;"/><span>资产附件图片</span></p>
					</li>
					<li style="float: left;">
						<p class="img-item"><img id="BasicImg2" style="width: 100px;height: 100px;"><span>资产附件图片</span></p>
					</li>
					<li style="float: left;">
						<p class="img-item"><img id="BasicImg3" style="width: 100px;height: 100px;"><span>资产附件图片</span></p>
					</li>
				</ul>
			</div>
		</div>
	</div>
</div>

<!--新增资产详细信息dialog-->
<div id="addBasicInfoDialog" class="easyui-dialog" title="资产详细资料" style="width: 930px; height: 500px;text-align:center;top:50px;display: none;overflow: hidden;" data-options="iconCls:'icon-save',resizable:true,modal:true,closed:true,closable:true ">
	<!--操作按钮-->
	<div style="width:70%;text-align: left;">
		<a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="closeDiv2()">关闭</a>
		<script>
			function closeDiv2() {
				$('#addBasicInfoDialog').window('close');
			}
		</script>
		<a href="#" class="easyui-linkbutton" iconCls="icon-save" plain="true" onclick="saveDiv()">保存</a>
		<script>
			function saveDiv() {
				 
				// var imgFile1 = $("#doc1");
				// var imgFile2 = $("#doc2");
				// var imgFile3 = $("#doc3");
				// if(imgFile1.val()==null||imgFile2.val()==null||imgFile3.val()==null||imgFile1.val()==''||imgFile2.val()==''||imgFile3.val()=='' ){
				// 	$.messager.alert("提示","需将三张图片导入")
				// 	return false;
				// }
				var EquName = $("#ADEquName").val();
				var LifeTime = $("#ADLifeTime").val();
				var BuyInTime = $("#ADBuyInTime").val();
				var ServCondition = $("#ADServCondition").val();
				var BuyInMoney = $("#ADBuyInMoney").val();
				var StartTime = $("#ADStartTime").val();
				var EndTime = $("#ADEndTime").val();
				var EquType = $('#ADEquType').combobox('getText');
				var PurchaseType = $("#ADPurchaseType").val();
				var Store = $("#ADStore").val();
				var EquStatus = $("#ADEquStatus").val();
				var EquNo = $("#ADEquNo").val();
				var ConsePeriod = $("#ADConsePeriod").val();
				var Specification = $("#ADSpecification").val();
				var Place = $("#ADPlace").val();
				var parentStore = parent.$("#store").val();
				var InputMan = $("#EnterMan").val();
				if(isNaN(LifeTime)){
				   $.messager.alert("提示","寿命选项请输入数字");
				   return false;
				}
                if(isNaN(BuyInMoney)){
                    $.messager.alert("提示","购入价格选项请输入数字");
                    return false;
                }
                if(isNaN(ConsePeriod)){
                    $.messager.alert("提示","维护周期选项请输入数字");
                    return false;
                }
				if(Store!=parentStore){
					$.messager.alert("提示","不能录入与录入人所在中心店面不同的中心店面资产")
					return false;
				}
				if(EquNo==null||EquNo==""){
					$.messager.alert("提示","设备编号不能为空")
					return false;
				}
                if(ConsePeriod==null||ConsePeriod==""){
                    $.messager.alert("提示","维护周期不能为空")
                    return false;
                }
                var EquData = {
				    "EquNo":EquNo
				}
				var Equ_Data = JSON.stringify(EquData);
                $.ajax({
                    url: "../../goLogis/queryBasicEquByEquNo", //请求的url地址
                    dataType: "json", //返回格式为json
                    data: Equ_Data, //参数值
                    type: "POST", //请求方式
                    processData: false, //对表单data数据是否进行序列化
                    contentType: false, //dataType设置你收到服务器数据的格式
                    headers: {
                        'Content-Type': 'application/json'
                    },
                    beforeSend: function() {
                        //请求前的处理
                    },
                    success: function(data) {
						if(data.status=="0"){
						    $.messager.alert("提示",EquNo+"该资产编号已被占用，请更改资产编号");
						    return false;
						}else{
                            var jsondata = {
                                "EquName": EquName,
                                "LifeTime": LifeTime,
                                "BuyInTime": BuyInTime,
                                "ServCondition": ServCondition,
                                "BuyInMoney": BuyInMoney,
                                "StartTime": StartTime,
                                "EndTime": EndTime,
                                "EquType": EquType,
                                "PurchaseType": PurchaseType,
                                "Store": Store,
                                "EquStatus": EquStatus,
                                "EquNo": EquNo,
                                "ConsePeriod": ConsePeriod,
                                "Specification": Specification,
                                "Place": Place,
                                "InputMan":InputMan
                            }
                            if(EquName==""||EquName==null){
                                $.messager.alert("提示","资产名称不可为空");
                                return false;
							}
                            if(LifeTime==""||LifeTime==null){
                                $.messager.alert("提示","寿命不可为空");
                                return false;
                            }
                            if(BuyInMoney==""||BuyInMoney==null){
                                $.messager.alert("提示","购入金额不可为空");
                                return false;
                            }
                            if(StartTime==""||StartTime==null){
                                $.messager.alert("提示","使用开始时间不可为空");
                                return false;
                            }
                            if(EndTime==""||EndTime==null){
                                $.messager.alert("提示","使用截止时间不可为空");
                                return false;
                            }
                            if(EquType==""||EquType==null){
                                $.messager.alert("提示","类别不可为空");
                                return false;
                            }
                            if(Place==""||Place==null){
                                $.messager.alert("提示","存放地点不可为空");
                                return false;
                            }
                            if(BuyInTime==""||BuyInTime==null){
                                $.messager.alert("提示","购入时间不可为空");
                                return false;
                            }
                            if(Specification==""||Specification==null){
                                $.messager.alert("提示","型号-规格不可为空");
                                return false;
                            }
                            var data_json = JSON.stringify(jsondata);
                            $.ajax({
                                url: "../../goLogis/saveBasicEqu", //请求的url地址
                                dataType: "json", //返回格式为json
                                data: data_json, //参数值
                                type: "POST", //请求方式
                                processData: false, //对表单data数据是否进行序列化
                                contentType: false, //dataType设置你收到服务器数据的格式
                                headers: {
                                    'Content-Type': 'application/json'
                                },
                                beforeSend: function() {
                                    //请求前的处理
                                },
                                success: function(data) {
                                    $.messager.alert('保存资产信息', data.status);
                                    $("#dg").datagrid('reload');
                                    $('#addBasicInfoDialog').dialog('close');
                                },
                                complete: function() {
                                },
                                error: function() {
                                }
                            });
						}

					},
                    complete: function() {
                    },
                    error: function() {

                    }
                });


				
			}
		</script>
	</div>
	<!--资产基本信息-->
	<div>
		<div class="panel-header" style="width:918px;text-align: left;">
			<div class="panel-title">资产基本信息</div>
			<div class="panel-tool"></div>
		</div>
		<table width="900" height="149" class="BuyBack">
			<tr>
				<td width="87" class="odd"><span>设备编号</span></td>
				<td width="127" class="even"><span><input type="text" style="width:120px;height: 23px"
														  id="ADEquNo" required="required" /></span></td>
				<td width="109" height="36" class="odd"><span>资产名称</span></td>
				<td width="127" class="even"><span><input type="text" style="width: 120px;height: 23px"
	                                                      id="ADEquName" /></span></td>
				<td width="84" class="odd"><span>寿命（年）</span></td>
				<td width="127" class="even"><span><input type="text" style="width: 120px;height: 23px"
	                                                      id="ADLifeTime"/></span></td>
				<td width="87" class="odd"><span>使用状况</span></td>
				<td width="127" class="even"><span>
					<select id="ADServCondition" style="width:120px;" class="easyui-combobox" editable="false">
						<option value="良好">良好</option>
						<option value="故障">故障</option>
						<option value="已停用">已停用</option>
					</select></span></td>
			</tr>
			<tr>
				<td width="109" height="36" class="odd"><span>购入价格(元)</span></td>
				<td width="127" class="even"><span><input type="text" style="width: 120px;height: 23px" 
	                                                      id="ADBuyInMoney" /></span></td>
				<td width="84" class="odd"><span>开始使用时间</span></td>
				<td width="127" class="even"><span><input type="text" class="easyui-datebox" editable="false" style="width: 120px;height: 23px"
	                                                      id="ADStartTime"/></span></td>
				<td width="87" class="odd"><span>截止使用时间</span></td>
				<td width="127" class="even"><span><input type="text" class="easyui-datebox" editable="false" style="width: 120px;height: 23px"
	                                                      id="ADEndTime"/></span></td>
				<td width="87" class="odd"><span>类别</span></td>
				<td width="127" class="even"><span>
                    <select id="ADEquType" style="width: 120px;height: 23px" class="easyui-combobox"  panelHeight="auto" data-options="valueField:'id', textField:'text'" editable="false">
						<option value="">请选择类别</option>
                    </select>
					</span></td>
			</tr>
			<tr>
				<td width="109" height="36" class="odd"><span>购置方式</span></td>
				<td width="127" class="even"><span>
					<select class="easyui-combobox" id="ADPurchaseType" style="width:120px;" editable="false">
						<option value="购入">购入</option>
						<option value="接收">接收</option>
                        <option value="租用">租用</option>
					</select></span></td>
				<td width="87" class="odd"><span>存放地点</span></td>
				<td width="127" class="even"><span><input type="text" style="width: 120px;height: 23px"
														  id="ADPlace"/></span></td>
				<td width="87" class="odd"><span>所处状态</span></td>
				<td width="127" class="even"><span>
					<select class="easyui-combobox" id="ADEquStatus" style="width:120px;" editable="false">
						<option value="在用">正常</option>
						<option value="停用">已停用</option>
					</select></span></td>
				<td width="109" height="36" class="odd"><span>购入时间</span></td>
				<td width="127" class="even"><span><input type="text" class="easyui-datebox" editable="false" style="width: 120px;height: 23px"
														  id="ADBuyInTime" /></span></td>
			</tr>
			<tr>
				<td width="84" class="odd"><span>型号-规格</span></td>
				<td width="127" class="even"><span>
					<input style="width: 120px;height: 23px"  type="text" id="ADSpecification" />
				</span></td>
				<td width="109" height="36" class="odd" ><span>维护周期（天）</span></td>
				<td width="127" class="even" ><span><input type="text" style="width: 120px;height: 23px;" id="ADConsePeriod" /></span></td>
				<td width="84" class="odd" style="display: none"><span>中心店面</span></td>
				<td width="127" class="even" style="display: none"><span>
					<input type="text" id="ADStore" readonly="readonly"/>
					</span></td>

	            <td width="87" class="odd" style="display: none"><span>录入人</span></td>
				<td width="127" class="even" style="display: none"><span><input type="text" style="width: 120px;height: 23px"
	                                                      id="EnterMan" readonly="readonly" /></span></td>

			</tr>
		</table>
		
	</div>
	<!--<div style="margin :0px auto; width:990px;float: left;">
		<div style="float: left;display: inline">
			<a href="javascript:;" class="a-upload">
    			<input type="file" name="file" id="doc1" multiple="multiple"  accept="image/*" onchange="javascript:setImagePreviews1('doc1');"/>
    			<input type="file" name="file" id="doc2" multiple="multiple"  accept="image/*" onchange="javascript:setImagePreviews2('doc2');"/>
				<input type="file" name="file" id="doc3" multiple="multiple"  accept="image/*" onchange="javascript:setImagePreviews3('doc3');"/>
			</a>
		</div>
		<div style="clear: both"></div>
		<div style="display: inline">
			<div id="doc1dd" style=" width:200px;float: left;"></div>
			<div id="doc2dd" style=" width:200px;float: left;"></div>
			<div id="doc3dd" style=" width:200px;float: left;"></div>
		</div>
	</div>-->

</div>

<!--E修改资产信息弹框-->
<div id="editBasicInfoDialog" class="easyui-dialog" title="资产详细资料" style="width: 930px; height: 500px;text-align:center;top:50px;display: none;overflow: hidden;" data-options="iconCls:'icon-save',resizable:true,modal:true,closed:true,closable:true ">
	<!--E操作按钮-->
	<div style="width:70%;text-align: left;">
		<a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="closeDiv3()">关闭</a>
		<script>
			function closeDiv3() {
				$('#editBasicInfoDialog').window('close');
			}
		</script>
		<a href="#" class="easyui-linkbutton" iconCls="icon-save" plain="true" onclick="editDiv3()">修改完成</a>
		<script>
			function editDiv3() {
				var imgFile1 = $("#edoc1");
				var imgFile2 = $("#edoc2");
				var imgFile3 = $("#edoc3");
				var EquName = $("#EADEquName").val();
				var LifeTime = $("#EADLifeTime").val();
				var BuyInTime = $("#EADBuyInTime").val();
				var ServCondition = $("#EADServCondition").val();
				var BuyInMoney = $("#EADBuyInMoney").val();
				var StartTime = $("#EADStartTime").val();
				var EndTime = $("#EADEndTime").val();
				var EquType = $('#EADEquType').combobox('getText');
				var PurchaseType = $("#EADPurchaseType").val();
				var Store = $("#EADStore").val();
				var EquStatus = $("#EADEquStatus").val();
				var EquNo = $("#EADEquNo").val();
				var ConsePeriod = $("#EADConsePeriod").val();
				var Specification = $("#EADSpecification").val();
				var Place = $("#EADPlace").val();
                if(isNaN(LifeTime)){
                    $.messager.alert("提示","寿命选项请输入数字");
                    return false;
                }
                if(isNaN(BuyInMoney)){
                    $.messager.alert("提示","购入价格选项请输入数字");
                    return false;
                }
                if(EquName==""||EquName==null){
                    $.messager.alert("提示","资产名称不可为空");
                    return false;
                }
                if(LifeTime==""||LifeTime==null){
                    $.messager.alert("提示","寿命不可为空");
                    return false;
                }
                if(BuyInMoney==""||BuyInMoney==null){
                    $.messager.alert("提示","购入金额不可为空");
                    return false;
                }
                if(StartTime==""||StartTime==null){
                    $.messager.alert("提示","使用开始时间不可为空");
                    return false;
                }
                if(EndTime==""||EndTime==null){
                    $.messager.alert("提示","使用截止时间不可为空");
                    return false;
                }
                if(EquType==""||EquType==null){
                    $.messager.alert("提示","类别不可为空");
                    return false;
                }
                if(Place==""||Place==null){
                    $.messager.alert("提示","存放地点不可为空");
                    return false;
                }
                if(BuyInTime==""||BuyInTime==null){
                    $.messager.alert("提示","购入时间不可为空");
                    return false;
                }
                if(Specification==""||Specification==null){
                    $.messager.alert("提示","型号-规格不可为空");
                    return false;
                }
				var jsondata = {
					"EquName": EquName,
					"LifeTime": LifeTime,
					"BuyInTime": BuyInTime,
					"ServCondition": ServCondition,
					"BuyInMoney": BuyInMoney,
					"StartTime": StartTime,
					"EndTime": EndTime,
					"EquType": EquType,
					"PurchaseType": PurchaseType,
					"Store": Store,
					"EquStatus": EquStatus,
					"EquNo": EquNo,
					"ConsePeriod": ConsePeriod,
					"Specification": Specification,
					"Place": Place
				}
				var data_json = JSON.stringify(jsondata);
				$.ajax({
					url: "../../goLogis/updateBasicEquByEquNo", //请求的url地址
					dataType: "json", //返回格式为json
					data: data_json, //参数值
					type: "POST", //请求方式
					processData: false, //对表单data数据是否进行序列化
					contentType: false, //dataType设置你收到服务器数据的格式
					headers: {
						'Content-Type': 'application/json'
					},
					beforeSend: function() {

					},
					success: function(data) {
						if(data.status==2){
						}
						if(data.Status==1){
							$.messager.alert('修改资产信息', "修改成功");
							$("#dg").datagrid('reload');
							$('#editBasicInfoDialog').dialog('close');
						}else{
							$.messager.alert('修改资产信息', "修改失败");
							$("#dg").datagrid('reload');
							$('#editBasicInfoDialog').dialog('close');
						}
					},
					complete: function() {
					},
					error: function() {
					}
				});
				
				
				
			}
		</script>
	</div>
	<!--E资产基本信息-->
	<div>
		<div class="panel-header" style="width:918px;text-align: left;">
			<div class="panel-title">资产基本信息</div>
			<div class="panel-tool"></div>
		</div>
		<table width="900" height="149" class="BuyBack">
			<tr>
				<td width="87" class="odd"><span>设备编号</span></td>
				<td width="127" class="even"><span><input type="text" style="width: 120px;height: 23px"
														  id="EADEquNo" readonly="readonly"/></span></td>
				<td width="109" height="36" class="odd"><span>资产名称</span></td>
				<td width="127" class="even"><span><input type="text" style="width: 120px;height: 23px"
	                                                      id="EADEquName"  /></span></td>
				<td width="84" class="odd"><span>寿命（年）</span></td>
				<td width="127" class="even"><span><input type="text" style="width: 120px;height: 23px"
	                                                      id="EADLifeTime"/></span></td>
				<td width="87" class="odd"><span>使用状况</span></td>
				<td width="127" class="even"><span><select class="easyui-combobox" id="EADServCondition" style="width:120px;">
						<option value="良好">良好</option>
						<option value="故障">故障</option>
						<option value="已停用">已停用</option>
					</select></span></td></span></td>
			</tr>
			<tr>
				<td width="109" height="36" class="odd"><span>购入价格（元）</span></td>
				<td width="127" class="even"><span><input type="text" style="width: 120px;height: 23px" 
	                                                      id="EADBuyInMoney" /></span></td>
				<td width="84" class="odd"><span>开始使用时间</span></td>
				<td width="127" class="even"><span><input type="text" class="easyui-datebox" editable="false" style="width: 120px;height: 23px"
	                                                      id="EADStartTime"/></span></td>
				<td width="87" class="odd"><span>截止使用时间</span></td>
				<td width="127" class="even"><span><input type="text" class="easyui-datebox" editable="false" style="width: 120px;height: 23px"
	                                                      id="EADEndTime"/></span></td>
				<td width="87" class="odd"><span>类别</span></td>
				<td width="127" class="even"><span>
                    <select id="EADEquType" style="width: 120px;height: 23px" class="easyui-combobox"  panelHeight="auto" data-options="valueField:'id', textField:'text'" editable="false">

                    </select>
					</span></td>
			</tr>
			<tr>
				<td width="109" height="36" class="odd"><span>购置方式</span></td>
				<td width="127" class="even"><span>
				<select class="easyui-combobox" id="EADPurchaseType" style="width:120px;">
						<option value="购入">购入</option>
						<option value="接收">接收</option>
                        <option value="租用">租用</option>
					</select></span></td>
				<td width="84" class="odd"><span>中心店面</span></td>
				<td width="127" class="even"><span><input type="text" style="width: 120px;height: 23px" 
	                                                      id="EADStore" readonly="readonly" /></span></td>
				<td width="87" class="odd"><span>所处状态</span></td>
				<td width="127" class="even"><span><select class="easyui-combobox" id="EADEquStatus" style="width:120px;">
						<option value="在用">正常</option>
						<option value="已停用">已停用</option>
					</select></span></td>
				<td width="109" height="36" class="odd"><span>购入时间</span></td>
				<td width="127" class="even"><span><input type="text" class="easyui-datebox" editable="false" style="width: 120px;height: 23px"
														  id="EADBuyInTime" /></span></td>
			</tr>
			<tr>
				<td width="109" height="36" class="odd" ><span>维护周期（天）</span></td>
				<td width="127" class="even" ><span><input type="text" style="width: 120px;height: 23px;"
	                                                      id="EADConsePeriod" /></span></td>
				<td width="84" class="odd"><span>型号-规格</span></td>
				<td width="127" class="even"><span>
					<input type="text" id="EADSpecification" style="width:120px;"/></span></td>
				<td width="87" class="odd"><span>存放地点</span></td>
				<td width="127" class="even"><span><input type="text" style="width: 120px;height: 23px"
	                                                      id="EADPlace"/></span></td>

			</tr>
		</table>
		<!--<div style="margin :0px auto; width:990px;float: left;">
			<div style="float: left;display: inline">
				<a href="javascript:;" class="a-upload">
					<input type="file" name="file" id="doc1" multiple="multiple"  accept="image/*" onchange="javascript:setImagePreviews1('doc1');"/>
					<input type="file" name="file" id="doc2" multiple="multiple"  accept="image/*" onchange="javascript:setImagePreviews2('doc2');"/>
					<input type="file" name="file" id="doc3" multiple="multiple"  accept="image/*" onchange="javascript:setImagePreviews3('doc3');"/>
				</a>
			</div>
			<div style="clear: both"></div>
			<div style="display: inline">
				<div id="doc1dd" style=" width:200px;float: left;"></div>
				<div id="doc2dd" style=" width:200px;float: left;"></div>
				<div id="doc3dd" style=" width:200px;float: left;"></div>
			</div>
		</div>-->
	</div>

</div>

<!--上传修改图片-->
<script>
	function uploadEditImages() {
	    var EquNo = $("#EIEquNo").val();
        var imgFile1 = $("#doc4");
        var imgFile2 = $("#doc5");
        var imgFile3 = $("#doc6");
        if(imgFile1.val()==null||imgFile2.val()==null||imgFile3.val()==null||imgFile1.val()==''||imgFile2.val()==''||imgFile3.val()=='' ){
            $.messager.alert("提示","需将三张图片导入")
            return false;
        }
        for(var i=4;i<6;i++){
            $.ajaxFileUpload({
                url:'../../goLogis/uploadImage', //你处理上传文件的服务端
                data:{"EquNo":EquNo},
                secureuri:false,//是否启用安全机制
                fileElementId:'doc'+i,//file的id
                dataType: 'application/json',//返回的类型
                success: function (data) {//调用成功时怎么处理

                }
            });
        }
        $.ajaxFileUpload({
            url:'../../goLogis/uploadImage', //你处理上传文件的服务端
            data:{"EquNo":EquNo},
            secureuri:false,//是否启用安全机制
            fileElementId:'doc6',//file的id
            dataType: 'application/json',//返回的类型
            success: function (data) {//调用成功时怎么处理
                $.messager.alert("提示",data);
                $("#uploadEditImage").dialog("close");
            }
        });




    }
</script>
<div id="uploadEditImage" class="easyui-dialog" title="上传图片" style="width: 930px; height: 500px;text-align:center;top:50px;display: none;overflow: hidden;" data-options="iconCls:'icon-save',resizable:true,modal:true,closed:true,closable:true ">
	<a href="#" class="easyui-linkbutton" iconCls="icon-save" plain="true" onclick="uploadEditImages()">上传</a>
	<div style="margin :0px auto; width:990px;float: left;">
		<div style="float: left;display: inline">
			<a href="javascript:;" class="a-upload">
				<input type="file" name="file" id="doc4" multiple="multiple"  accept="image/*" onchange="javascript:setImagePreviews4('doc4');"/>
				<input type="file" name="file" id="doc5" multiple="multiple"  accept="image/*" onchange="javascript:setImagePreviews5('doc5');"/>
				<input type="file" name="file" id="doc6" multiple="multiple"  accept="image/*" onchange="javascript:setImagePreviews6('doc6');"/>
			</a>
		</div>
		<div style="clear: both"></div>
		<div style="display: inline">
			<div id="doc4dd" style=" width:200px;float: left;"></div>
			<div id="doc5dd" style=" width:200px;float: left;"></div>
			<div id="doc6dd" style=" width:200px;float: left;"></div>
		</div>
	</div>
	<input id="EIEquNo" style="display: none" readonly="readonly" >
</div>

<!--下面用于多图片上传预览功能-->
<script type="text/javascript">
function setImagePreviews1(avalue) {
    var docObj = document.getElementById(avalue);
    var dd = document.getElementById(avalue+"dd");
    dd.innerHTML = "";
    var fileList = docObj.files;
    for (var i = 0; i < fileList.length; i++) {
        dd.innerHTML += "<div style='float: left;margin-top: 10px;' > <img id='img1'  /> </div>";
        var imgObjPreview = document.getElementById("img1");
        if (docObj.files && docObj.files[i]) {
        //火狐下，直接设img属性
        // imgObjPreview.style.display = 'block';
            imgObjPreview.style.width = '160px';
            imgObjPreview.style.height = '130px';
            imgObjPreview.style.margin = '5px';
            imgObjPreview.style.borderRadius = '5px';
                //imgObjPreview.src = docObj.files[0].getAsDataURL();
                //火狐7以上版本不能用上面的getAsDataURL()方式获取，需要一下方式
            imgObjPreview.src = window.URL.createObjectURL(docObj.files[i]);
        }
        else {
               //IE下，使用滤镜
            docObj.select();
            var imgSrc = document.selection.createRange().text;
            var localImagId = document.getElementById("img1");
                //必须设置初始大小
            localImagId.style.width = "160px";
            localImagId.style.height = "130px";
            imgObjPreview.style.margin = '5px';
            imgObjPreview.style.borderRadius = '5px';
                //图片异常的捕捉，防止用户修改后缀来伪造图片
            try {
                localImagId.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale)";
                localImagId.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = imgSrc;
            }
            catch (e) {
                alert("您上传的图片格式不正确，请重新选择!");
                return false;
            }
            imgObjPreview.style.display = 'none';
            document.selection.empty();
        }
    }
        return true;

}
function setImagePreviews2(avalue) {
    var docObj = document.getElementById(avalue);
    var dd = document.getElementById(avalue+"dd");
    dd.innerHTML = "";
    var fileList = docObj.files;
    for (var i = 0; i < fileList.length; i++) {
        dd.innerHTML += "<div style='float: left;margin-top: 10px;' > <img id='img2'  /> </div>";
        var imgObjPreview = document.getElementById("img2");
        if (docObj.files && docObj.files[i]) {
            //火狐下，直接设img属性
            // imgObjPreview.style.display = 'block';
            imgObjPreview.style.width = '160px';
            imgObjPreview.style.height = '130px';
            imgObjPreview.style.margin = '5px';
            imgObjPreview.style.borderRadius = '5px';
            //imgObjPreview.src = docObj.files[0].getAsDataURL();
            //火狐7以上版本不能用上面的getAsDataURL()方式获取，需要一下方式
            imgObjPreview.src = window.URL.createObjectURL(docObj.files[i]);
        }
        else {
            //IE下，使用滤镜
            docObj.select();
            var imgSrc = document.selection.createRange().text;
            var localImagId = document.getElementById("img2");
            //必须设置初始大小
            localImagId.style.width = "160px";
            localImagId.style.height = "130px";
            imgObjPreview.style.margin = '5px';
            imgObjPreview.style.borderRadius = '5px';
            //图片异常的捕捉，防止用户修改后缀来伪造图片
            try {
                localImagId.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale)";
                localImagId.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = imgSrc;
            }
            catch (e) {
                alert("您上传的图片格式不正确，请重新选择!");
                return false;
            }
            imgObjPreview.style.display = 'none';
            document.selection.empty();
        }
    }
    return true;

}
function setImagePreviews3(avalue) {
    var docObj = document.getElementById(avalue);
    var dd = document.getElementById(avalue+"dd");
    dd.innerHTML = "";
    var fileList = docObj.files;
    for (var i = 0; i < fileList.length; i++) {
        dd.innerHTML += "<div style='float: left;margin-top: 10px;' > <img id='img3' style='float:left'  /> </div>";
        var imgObjPreview = document.getElementById("img3");
        if (docObj.files && docObj.files[i]) {
            //火狐下，直接设img属性
            // imgObjPreview.style.display = 'block';
            imgObjPreview.style.width = '160px';
            imgObjPreview.style.height = '130px';
            imgObjPreview.style.margin = '5px';
            imgObjPreview.style.borderRadius = '5px';
            //imgObjPreview.src = docObj.files[0].getAsDataURL();
            //火狐7以上版本不能用上面的getAsDataURL()方式获取，需要一下方式
            imgObjPreview.src = window.URL.createObjectURL(docObj.files[i]);
        }
        else {
            //IE下，使用滤镜
            docObj.select();
            var imgSrc = document.selection.createRange().text;
            var localImagId = document.getElementById("img3");
            //必须设置初始大小
            localImagId.style.width = "160px";
            localImagId.style.height = "130px";
            imgObjPreview.style.margin = '5px';
            imgObjPreview.style.borderRadius = '5px';
            //图片异常的捕捉，防止用户修改后缀来伪造图片
            try {
                localImagId.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale)";
                localImagId.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = imgSrc;
            }
            catch (e) {
                alert("您上传的图片格式不正确，请重新选择!");
                return false;
            }
            imgObjPreview.style.display = 'none';
            document.selection.empty();
        }
    }
    return true;

}

function setImagePreviews4(avalue) {
    var docObj = document.getElementById(avalue);
    var dd = document.getElementById(avalue+"dd");
    dd.innerHTML = "";
    var fileList = docObj.files;
    for (var i = 0; i < fileList.length; i++) {
        dd.innerHTML += "<div style='float: left;margin-top: 10px;' > <img id='img4' style='float:left'  /> </div>";
        var imgObjPreview = document.getElementById("img4");
        if (docObj.files && docObj.files[i]) {
            //火狐下，直接设img属性
            // imgObjPreview.style.display = 'block';
            imgObjPreview.style.width = '160px';
            imgObjPreview.style.height = '130px';
            imgObjPreview.style.margin = '5px';
            imgObjPreview.style.borderRadius = '5px';
            //imgObjPreview.src = docObj.files[0].getAsDataURL();
            //火狐7以上版本不能用上面的getAsDataURL()方式获取，需要一下方式
            imgObjPreview.src = window.URL.createObjectURL(docObj.files[i]);
        }
        else {
            //IE下，使用滤镜
            docObj.select();
            var imgSrc = document.selection.createRange().text;
            var localImagId = document.getElementById("img4");
            //必须设置初始大小
            localImagId.style.width = "160px";
            localImagId.style.height = "130px";
            imgObjPreview.style.margin = '5px';
            imgObjPreview.style.borderRadius = '5px';
            //图片异常的捕捉，防止用户修改后缀来伪造图片
            try {
                localImagId.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale)";
                localImagId.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = imgSrc;
            }
            catch (e) {
                alert("您上传的图片格式不正确，请重新选择!");
                return false;
            }
            imgObjPreview.style.display = 'none';
            document.selection.empty();
        }
    }
    return true;

}


function setImagePreviews5(avalue) {
    var docObj = document.getElementById(avalue);
    var dd = document.getElementById(avalue+"dd");
    dd.innerHTML = "";
    var fileList = docObj.files;
    for (var i = 0; i < fileList.length; i++) {
        dd.innerHTML += "<div style='float: left;margin-top: 10px;' > <img id='img5' style='float:left'  /> </div>";
        var imgObjPreview = document.getElementById("img5");
        if (docObj.files && docObj.files[i]) {
            //火狐下，直接设img属性
            // imgObjPreview.style.display = 'block';
            imgObjPreview.style.width = '160px';
            imgObjPreview.style.height = '130px';
            imgObjPreview.style.margin = '5px';
            imgObjPreview.style.borderRadius = '5px';
            //imgObjPreview.src = docObj.files[0].getAsDataURL();
            //火狐7以上版本不能用上面的getAsDataURL()方式获取，需要一下方式
            imgObjPreview.src = window.URL.createObjectURL(docObj.files[i]);
        }
        else {
            //IE下，使用滤镜
            docObj.select();
            var imgSrc = document.selection.createRange().text;
            var localImagId = document.getElementById("img5");
            //必须设置初始大小
            localImagId.style.width = "160px";
            localImagId.style.height = "130px";
            imgObjPreview.style.margin = '5px';
            imgObjPreview.style.borderRadius = '5px';
            //图片异常的捕捉，防止用户修改后缀来伪造图片
            try {
                localImagId.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale)";
                localImagId.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = imgSrc;
            }
            catch (e) {
                alert("您上传的图片格式不正确，请重新选择!");
                return false;
            }
            imgObjPreview.style.display = 'none';
            document.selection.empty();
        }
    }
    return true;

}


function setImagePreviews6(avalue) {
    var docObj = document.getElementById(avalue);
    var dd = document.getElementById(avalue+"dd");
    dd.innerHTML = "";
    var fileList = docObj.files;
    for (var i = 0; i < fileList.length; i++) {
        dd.innerHTML += "<div style='float: left;margin-top: 10px;' > <img id='img6' style='float:left'  /> </div>";
        var imgObjPreview = document.getElementById("img6");
        if (docObj.files && docObj.files[i]) {
            //火狐下，直接设img属性
            // imgObjPreview.style.display = 'block';
            imgObjPreview.style.width = '160px';
            imgObjPreview.style.height = '130px';
            imgObjPreview.style.margin = '5px';
            imgObjPreview.style.borderRadius = '5px';
            //imgObjPreview.src = docObj.files[0].getAsDataURL();
            //火狐7以上版本不能用上面的getAsDataURL()方式获取，需要一下方式
            imgObjPreview.src = window.URL.createObjectURL(docObj.files[i]);
        }
        else {
            //IE下，使用滤镜
            docObj.select();
            var imgSrc = document.selection.createRange().text;
            var localImagId = document.getElementById("img6");
            //必须设置初始大小
            localImagId.style.width = "160px";
            localImagId.style.height = "130px";
            imgObjPreview.style.margin = '5px';
            imgObjPreview.style.borderRadius = '5px';
            //图片异常的捕捉，防止用户修改后缀来伪造图片
            try {
                localImagId.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale)";
                localImagId.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = imgSrc;
            }
            catch (e) {
                alert("您上传的图片格式不正确，请重新选择!");
                return false;
            }
            imgObjPreview.style.display = 'none';
            document.selection.empty();
        }
    }
    return true;

}

</script>